home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / hypergraphLightMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.2 KB  |  92 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. // $Source: /vobs/aw/Maya/src/RenderUISlice/UI/scripts/hypergraphLightMenu.mel $
  18. // 
  19. // $Author: jcameron $
  20. // $Revision: /main/5 $
  21. // $Date: 2000/02/22 16:59:37 $
  22. // 
  23.  
  24. //
  25. //  Create context sensitive Hypergraph menu for shader nodes
  26. //  This is displayed with RMB on shader nodes
  27. //
  28. proc createLightMenuItems( string $editor, string $menu )
  29. {
  30.     setParent -m $menu;
  31.     
  32.     //menuItem -l "Light" LightMenuTitleItem;
  33.     menuItem  LightMenuTitleItem;
  34.     menuItem -divider true;    
  35.     menuItem -divider true;    
  36.     menuItem -l "Graph Light Network" LightUpstreamItem;
  37.     menuItem -divider true;    
  38.     menuItem -l "Make Links with Selected Objects" LightAssignItem;
  39.     menuItem -l "Break Links with Selected Objects" LightUnassignItem;
  40.     menuItem -divider true;    
  41.     menuItem -l "Select Objects Illuminated by Light" LightShowObjectsItem;
  42.     menuItem -l "Frame Objects Illuminated by Light" LightFrameObjectsItem;
  43.     menuItem -divider true;
  44.     menuItem -l "Attribute Editor..." SingleAttrEditorItem;
  45.     menuItem -l "Rename" RenameItem;
  46. }
  47.  
  48. //
  49. // Define context sensitive Hypergraph menu for shader nodes
  50. //
  51. proc defineLightMenuCommands(string $editor, string $menu, string $node)
  52. {
  53.     // The visor uses a hyper graph panel, so the only way to tell
  54.     // that we are in the visor is by the name
  55.     //
  56.     int $isVisor = gmatch( $editor, "*VisorEd" );
  57.  
  58.     menuItem -edit
  59.         -l ("Light: " + $node) LightMenuTitleItem;
  60.     menuItem -edit -c 
  61.         ("lightlink -make -light " + $node + " -useActiveObjects") 
  62.         LightAssignItem;
  63.     menuItem -edit -c 
  64.         ("lightlink -break -light " + $node + " -useActiveObjects") 
  65.         LightUnassignItem;
  66.     menuItem -edit -c 
  67.         ("selectObjectsIlluminatedBy " + $node)
  68.         LightShowObjectsItem;
  69.     menuItem -edit -c 
  70.         ("selectObjectsIlluminatedBy " + $node + "; fitAllPanels -selected") 
  71.         LightFrameObjectsItem;
  72.     menuItem -edit -c 
  73.         ("hyperShade -shaderNetwork "+$node+" "+$editor)
  74.         -enable (!$isVisor)
  75.         LightUpstreamItem;
  76.     menuItem -edit -c 
  77.         ("hyperGraph -e -rename -useFeedbackList " + $editor) 
  78.         RenameItem;
  79.     menuItem -edit -c 
  80.         ("hyperGraph -e -attributeEditor single -useFeedbackList " + $editor)
  81.         SingleAttrEditorItem;
  82. //    menuItem -edit -c 
  83. //        ("hyperShade -hideNode "+$node+" "+$editor)
  84. //        LightHideItem;
  85. }
  86.  
  87. global proc hypergraphLightMenu(string $editor, string $menu, string $node)
  88. {
  89.     createLightMenuItems($editor, $menu);
  90.     defineLightMenuCommands($editor, $menu, $node);
  91. }
  92.